//计算器
function cal(c){
    //结果
    var res = 0;
    //整数1
    var c1 = document.querySelector("#n1").value;
    //整数2
    var c2 = document.querySelector("#n2").value;
    //字符串转换数字
    c1 = Number(c1);
    c2 = Number(c2);
    //判断计算方式
    switch (c){
        case "+":
            res = c1 + c2;
            break;
        case "-":
            res = c1 - c2;
            break;
        case "*":
            res = c1 * c2;
            break;
        case "/":
            res = c1 / c2;
            break;
    }
    //运算结果
    document.querySelector("#res").value = res;
}